package com.itheima.consumer.listener;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Classname OrderlyMessageListener
 * @Description TODO
 * @Date 2021/3/22 11:23
 * @Created by gan
 */
@Component
@RocketMQMessageListener(
        topic = "orderlyTopic36",consumerGroup = "orderlyGroup"
        ,consumeMode= ConsumeMode.ORDERLY
)
public class OrderlyMessageListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        System.out.println("当前线程："+Thread.currentThread().getName()+",接收到消息：="+s);
    }
}
